﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PepsiCo.Business;

namespace PepsiCo.UI.Specially
{
    public partial class InteractionServer : BasePage
    {
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            if (!IsAdmin())
                RedirectToPage(DefaultURL);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

            }
        }

        protected void btnOk_Click(object sender, EventArgs e)
        {
            if (IsRefresh) return;
            try
            {
                string query = txtQuery.Text.Trim();
                new DataAccess().ExecuteUpdate(query);
            }
            catch (Exception ex)
            {
                ClientScript.RegisterStartupScript(this.GetType(), "", "alert(\"" + ex.Message + "\")", true);
            }
        }

        protected void btnCancel_Click(object sender, EventArgs e)
        {
            RedirectToPage(DefaultURL);
        }
    }
}